#!/usr/bin/env python
# vim:fileencoding=utf-8

from calibre.web.feeds.news import BasicNewsRecipe


class Sotavision(BasicNewsRecipe):
    title = u'SOTA.Vision'
    description = u'\u0420\u043E\u0441\u0441\u0438\u0439\u0441\u043A\u043E\u0435 \u043D\u0435\u0437\u0430\u0432\u0438\u0441\u0438\u043C\u043E\u0435 \u043E\u0431\u0449\u0435\u0441\u0442\u0432\u0435\u043D\u043D\u043E-\u043F\u043E\u043B\u0438\u0442\u0438\u0447\u0435\u0441\u043A\u043E\u0435 \u043C\u0435\u0434\u0438\u0430, \u0441\u0444\u043E\u043A\u0443\u0441\u0438\u0440\u043E\u0432\u0430\u043D\u043D\u043E\u0435 \u043D\u0430 \u043E\u0441\u0432\u0435\u0449\u0435\u043D\u0438\u0438 \u043D\u0430\u0440\u0443\u0448\u0435\u043D\u0438\u044F \u043F\u0440\u0430\u0432 \u0447\u0435\u043B\u043E\u0432\u0435\u043A\u0430 \u0438 \u043F\u043E\u043B\u0438\u0442\u0438\u0447\u0435\u0441\u043A\u043E\u043C \u043F\u0440\u0435\u0441\u043B\u0435\u0434\u043E\u0432\u0430\u043D\u0438\u0438 \u0432 \u0420\u043E\u0441\u0441\u0438\u0438.'  # noqa: E501
    __author__ = 'bugmen00t'
    publisher = '\u0410\u043B\u0435\u043A\u0441\u0430\u043D\u0434\u0440\u0430 \u0410\u0433\u0435\u0435\u0432\u0430, \u041E\u043B\u0435\u0433 \u0415\u043B\u0430\u043D\u0447\u0438\u043A,  \u0415\u0432\u0433\u0435\u043D\u0438\u0439 \u0414\u043E\u043C\u043E\u0436\u0438\u0440\u043E\u0432'  # noqa: E501
    publication_type = 'news'
    oldest_article = 7
    max_articles_per_feed = 10
    language = 'ru'
    cover_url = 'https://upload.wikimedia.org/wikipedia/commons/thumb/a/ac/SotaVision.png/600px-SotaVision.png'
    auto_cleanup = False
    no_stylesheets = True

    remove_tags_before = dict(name='h1')

    remove_tags_after = dict(name='span', attrs={'style': 'border-color:#EBEBEB;border-width:1px;width:100%;'})

    remove_tags = [
        dict(name='div', attrs={'class': 'td_block_wrap tdb_mobile_menu tdi_7 td-pb-border-top td_block_template_1 tdb-header-align'}),
        dict(name='div', attrs={'class': 'td_block_wrap tdb_single_author tdi_52 td-pb-border-top td_block_template_1 tdb-post-meta'}),
        dict(name='div', attrs={'class': 'td_block_wrap tdb_single_date tdi_53 td-pb-border-top td_block_template_1 tdb-post-meta'}),
        dict(name='div', attrs={'class': 'td_block_wrap tdb_single_post_views tdi_54 td-pb-border-top td_block_template_1 tdb-post-meta'}),
        dict(name='div', attrs={'class': 'td_block_wrap tdb_single_post_share tdi_55  td-pb-border-top td_block_template_1'}),
        dict(name='div', attrs={'class': 'td-post-sharing-visible'}),
        ]

    feeds = [
        ('\u0412\u0441\u0435 \u043C\u0430\u0442\u0435\u0440\u0438\u0430\u043B\u044B', 'https://sotavision.world/feed/'),
        ('\u041D\u043E\u0432\u043E\u0441\u0442\u0438', 'https://sotavision.world/category/news/feed/'),
        ('\u0418\u0441\u0442\u043E\u0440\u0438\u0438', 'https://sotavision.world/category/stories/feed/'),
        ('\u0412\u0438\u0434\u0435\u043E', 'https://sotavision.world/category/videos/feed/'),
        ('\u0424\u043E\u0442\u043E', 'https://sotavision.world/category/photos/feed/'),
        ('\u041A\u0430\u0440\u0442\u043E\u0447\u043A\u0438', 'https://sotavision.world/category/projects/feed/'),
        ('\u041C\u043D\u0435\u043D\u0438\u044F', 'https://sotavision.world/category/opinions/feed/'),
    ]
